package cn.col.gszf.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;

import java.time.LocalDateTime;

/**
* @Description 用户投票信息类
* @Author: wanghong
* @Date: 2024/6/17
*/
@Data
@NoArgsConstructor
@TableName("user_votes")
public class UserVotes {

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    @TableField("user_ip")
    private String userIP;

    @TableField("vid")
    public String VID;

    @TableField("channel_id")
    public Integer channelId;

    @TableField("votes")
    public String votes;

    @CreatedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_at")
    private LocalDateTime createAt;

    public UserVotes(String userIP, String VID, Integer channelId, String votes){
        this.userIP=userIP;
        this.VID=VID;
        this.channelId = channelId;
        this.votes = votes;
    }
}
